package com.ksd.api.bean;

import com.ksd.api.utils.JSONUtil;
import lombok.Data;

@Data
public class SynchApkResponse {
    private String apkPath;
    private String apkName;
    private String apkVersion;
    private String message;
    private Integer status; //返回0表示需要同步,表示-1表示不需要同步

    public String setError(String message) {
        SynchApkResponse response = new SynchApkResponse();
        response.setStatus(-1);
        response.setMessage(message);

        return JSONUtil.objectToStr(response);
    }

    public String setSuccess(SynchApkResponse response) {
        response.setStatus(0);
        response.setMessage("success");

        return JSONUtil.objectToStr(response);
    }
}
